package com.okq.service.Impl;

import com.okq.dao.GroupDao;
import com.okq.entity.Group;
import com.okq.service.IGroupService;
import com.okq.util.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 描述 : 部门业务接口实现
 * 作者 : zdl
 * 日期 : 2017/6/28 13:47
 */
@Transactional // 启用事务机制
@Service
public class GroupServiceImpl implements IGroupService {

    @Autowired
    private GroupDao groupDap;

    @Override
    public void saveGroup(Group group) {
        groupDap.saveGroup(group);
    }

    @Override
    public void deleteGroup(Group group) {
        groupDap.deleteGroup(group);
    }

    @Override
    public void updateGroup(Group group) {
        groupDap.updateGroup(group);
    }

    @Override
    public void saveOrUpdateGroup(Group group) {
        groupDap.saveOrUpdateGroup(group);
    }

    @Override
    public Group getGroupById(String id) {
        return groupDap.getGroupById(id);
    }

    @Override
    public List<Group> listAllGroup() {
        return groupDap.listAllGroup();
    }

    @Override
    public List<Group> listGroupByComId(String comId) {
        return groupDap.listGroupByComId(comId);
    }

    @Override
    public Page<Group> pageByGroup(Page<Group> page, Group group) {
        return groupDap.pageByGroup(page, group);
    }

    @Override
    public Group getGroupByName(String groupName, String companyId) {
        return groupDap.getGroupByName(groupName, companyId);
    }


}
